package com.example.idachuappone.person.entity;

import java.io.Serializable;
import org.json.JSONObject;

public class QuanResults implements Serializable {
    private Coupon coupon;
    private String dateline;
    private String discount;
    private String from;
    private String id;
    private String status;
    private String to;

    public QuanResults parseJson(JSONObject json) {
        if (json == null) {
            return null;
        }
        if (json.has("id")) {
            this.id = json.optString("id");
        }
        if (json.has("status")) {
            this.status = json.optString("status");
        }
        if (json.has("from")) {
            this.from = json.optString("from");
        }
        if (json.has("to")) {
            this.to = json.optString("to");
        }
        if (json.has("dateline")) {
            this.dateline = json.optString("dateline");
        }
        if (json.has("discount")) {
            this.discount = json.optString("discount");
        }
        if (!json.has("coupon")) {
            return this;
        }
        this.coupon = new Coupon();
        this.coupon.parseJson(json.optJSONObject("coupon"));
        return this;
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDateline() {
        return this.dateline;
    }

    public void setDateline(String dateline) {
        this.dateline = dateline;
    }

    public Coupon getCoupon() {
        return this.coupon;
    }

    public void setCoupon(Coupon coupon) {
        this.coupon = coupon;
    }

    public String getFrom() {
        return this.from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return this.to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getDiscount() {
        return this.discount;
    }

    public void setDiscount(String discount) {
        this.discount = discount;
    }
}
